<%@page import="com.erp.dto.User"%>
<%@page import="com.erp.dto.Privilege"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
	+ request.getServerName() + ":" + request.getServerPort()
	+ path + "/";
	
	List<Privilege> privilegeList = (List<Privilege>)application.getAttribute("privilegeList");
	User user = (User) session.getAttribute("user");
%>
<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">
<meta charset="utf-8">
<title>jQuery UI Accordion - No auto height</title>
<link rel="stylesheet" href="script/jquery-ui-1.10.4/themes/base/jquery.ui.all.css">
<script src="script/jquery-ui-1.10.4/jquery-1.10.2.js"></script>
<script src="script/jquery-ui-1.10.4/ui/jquery.ui.core.js"></script>
<script src="script/jquery-ui-1.10.4/ui/jquery.ui.widget.js"></script>
<script src="script/jquery-ui-1.10.4/ui/jquery.ui.accordion.js"></script>
<script src="script/jquery-ui-1.10.4/ui/jquery.ui.button.js"></script>
<script src="script/script.js"></script>
<link rel="stylesheet" href="script/jquery-ui-1.10.4/demos/demos.css">
<link rel="stylesheet" href="style/style.css">
<script>
	$(function() {
		init_left_page();
	});
</script>
</head>
<body>
	<div id="accordion">
		<s:iterator value="#session.userPrivilegeList" id="topPrivilege">
			<s:if test="%{#topPrivilege.level==1}">
				<h3>
					<s:property value="#topPrivilege.name" />
				</h3>
				<div style="padding:0;">
					<s:iterator value="#session.userPrivilegeList" id="nextPrivilege">
						<s:if test="%{#nextPrivilege.level==2&&#nextPrivilege.parentId==#topPrivilege.id}">
							<a href="<s:property value="#nextPrivilege.url" />.action"
								class="item" target="right"><s:property
									value="#nextPrivilege.name" /></a>
						</s:if>
					</s:iterator>
				</div>
			</s:if>
		</s:iterator>
	</div>
</body>
</html>
